<!-- ZmWebViewPage -->
<template>
  <div class="ZmWebView">
    <iframe v-if="url" :src="url" />
  </div>
</template>

<script>
  import pub from '@/utils/public.js'
  import * as auth from '@/utils/auth'
  export default {
    name: 'ZmWebViewPage',
    data() {
      return {
        url: ''
      }
    },
    created() {
      this.init()
    },
    methods: {
      // 初始化方法
      init() {
        const url = auth.sLoc.get('url')
        this.url = url
        auth.sLoc.remove('url')
        const title = this.$route.query.title || ''
        if (title) {
          pub.setPageTitle(title)
        }
      }
    }
  }
</script>
<style lang="scss" scoped>
  .ZmWebView {
    width: 100%;
    height: 100%;
    // padding-top: 0.5*100rpx;
    box-sizing: border-box;
    iframe {
      width: 100%;
      height: 100%;
      border: none;
    }
  }
</style>
